export function parseOptions(data, cb) {
  return Object.keys(data).map((value) => ({ value, label: typeof cb === 'function' ? cb(data[value]) : data[value] }));
}

export function parseAllOptions(data, cb, opt = { value: ' ', label: '全部' }) {
  const options = parseOptions(data, cb);
  return [opt, ...options];
}